<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>过渡动画</title>
    <style>
        div {
            width: 300px;
            height: 300px;
            margin: 0 auto;
            background-color: black;
            /* 设置了transition，那div任何属性的改动都会有过渡动画 */
            transition: all 1s ease;
        }

        div:hover {
            background-color: yellow;
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>